<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>会员充值</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link type="text/css" rel="stylesheet" href="css/style.css" />
    <script type="text/javascript" src="/EasyBuy/statics/js/menu.js"></script>
	<script type="text/javascript" src="/EasyBuy/statics/js/select.js"></script>
   	<script type="text/javascript" src="/EasyBuy/statics/js/jquery-1.8.2.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
				$(".money").attr("class","now");
				$("#remark").blur(function (){
					if($("#remark").val()=="" || $("#remark").val()==null){
						$("#remarkdiv").text("会员备注不能为空!");
						$("#remarkdiv").css("color","red");
						$("#remark").focus();
					}else if($("#remark").val()!="" || $("#remark").val() !=null){
						$("#remarkdiv").text("");
					}
				});
				
				
				
				function money(){
					$.get("BalanceServlet","opr=selectBal&userid=${applicationScope.id}",hmoney);
				}
				function hmoney(data){
					$("#hymoney").text(data);
				}
				money();
				
				
				$(".btn_tj").click(function (){
					if($("#rechargemoney").val() == ""){
						$("#rechargemoneydiv").html("请输入要充值的金额");
						$("#rechargemoney").focus();
					}else{
						var zf="";
						if($("input[name=bank]").attr("checked")){
							zf="1";
						}else if($("input[name=Alipay]").attr("checked")){
							zf="2";
						}
						$.get("/EasyBuy/BalanceServlet","opr=recharge&userid=${applicationScope.id}&money="+$("#rechargemoney").val()+"&remark="+$("#remark").val(),fs);
						
						function fs(data){
							if(data == "cg"){
								location.href="/EasyBuy/backend/order/Member_Money_Pay.jsp?zffs="+zf+"&money="+$("#rechargemoney").val()+"&remark="+$("#remark").val();
							}else{
								alert("充值失败,请联系管理员");
							}
						}
						
					}
					
				});	
		});
	</script>
  </head>
  
  <body>
  <c:choose>
	  	<c:when test="${empty applicationScope.id}">
	  		<% response.sendRedirect("/EasyBuy/pre/Login.jsp");%>
	  	</c:when>
	  	<c:otherwise>
	  		<%@ include file="../../common/header.jsp" %>
			<%@ include file="../../common/backendHeader.jsp" %>
			 <c:choose>
				<c:when test="${empty applicationScope.type }">
					<% 	request.getRequestDispatcher("../../UserServlet?opr=type&href=Member_Address&href1=order").forward(request, response); %>
				</c:when>
				<c:otherwise>
					<c:if test="${applicationScope.type==1 }">
		  				<%@ include file="../../common/sideMamber.jsp" %> 
					</c:if>
					<c:if test="${applicationScope.type==0 }">
						<%@ include file="../../common/sideUser.jsp" %> 
					</c:if>
				</c:otherwise>
			 </c:choose>
	  	</c:otherwise>
  	</c:choose>
	 
		<div class="m_right">
            <p></p>
            <div class="mem_tit">
            	<span class="fr" style="font-size:12px; color:#55555; font-family:'宋体'; margin-top:5px;"></span><span class="fl" style="color:#ff4e00; font-size:14px;">会员当前可用余额：￥ <b id="hymoney"></b></span>
            </div>
			<table border="0" class="ma_tab" style="width:930px; margin-bottom:30px;" cellspacing="0" cellpadding="0">
              <tr>
              	<td class="ma_a" colspan="3" align="right"><a href="/EasyBuy/backend/order/Member_Money_Charge.jsp">充值</a>|<a href="/EasyBuy/backend/order/Member_Cash.jsp">提现</a>|<a href="/EasyBuy/backend/order/Member_Money.jsp">查看账户明细</a>|<a href="/EasyBuy/backend/order/Member_Money.jsp">查看申请记录</a></td>
              </tr>
              <tr>
                <td>充值金额</td>
                <td colspan="2"><input type="text"  class="add_ipt" style="width:190px;" id="rechargemoney"/><div id="rechargemoneydiv"></div></td>
              </tr>
              <tr valign="top" height="180">
                <td>会员备注</td>
                <td colspan="2" style="padding-top:10px;"><textarea class="add_txt" style="width:540px; height:130px;" id="remark"></textarea><div id="remarkdiv"></div></td>
              </tr>
              <tr>
                <td colspan="3">支付方式</td>
              </tr>
              <tr>                                                                                                                                   
                <td width="200" align="center">名称</td>                                                            
                <td width="500" align="center">描述</td>
                <td width="230" align="center">手续费</td>                   
              </tr>
              <tr>
                <td><label class="r_rad"><input type="checkbox" name="bank" checked="checked"  value="银行汇款 / 转账"/></label><label class="r_txt">银行汇款 / 转账</label></td>
                <td>
                	银行名称 收款人信息：全称 ××× ；帐号或地址 ××× ；开户行 ×××。 <br />
                    注意事项：办理电汇时，请在电汇单“汇款用途”一栏处注明您的订单号。
                </td>
                <td align="center">0</td>
              </tr>
              <tr>
                <td><label class="r_rad"><input type="checkbox" name="Alipay" value="支付宝" /></label><label class="r_txt">支付宝</label></td>
                <td>
                	支付宝网站(www.alipay.com) 是国内先进的网上支付平台。<br />
                    支付宝收款接口：在线即可开通，<font color="#ff4e00">零预付，免年费，</font>单笔阶梯费率，无流量限制。<br />
                    <a href="#" style="color:#ff4e00;">立即在线申请</a>
                </td>
                <td align="center">0</td>
              </tr>
              <tr>
                <td colspan="7" align="right">您当前的可用资金为：￥0.00</td>
              </tr>
			</table>
            
            <p align="center">
            	<input type="button" value="提交申请" class="btn_tj" />&nbsp; &nbsp; <input type="reset" value="重置表单" class="btn_tj" />
            </p>
        </div>
		 <%@ include file="../../common/footer.jsp" %>    <!--引入下边栏-->
  </body>
</html>
